<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Client Profile</title>
<link rel="stylesheet" type="text/css" href="css/style-old.css" />
<link rel="stylesheet" type="text/css" href="css/tcal.css" />
<link rel="stylesheet" type="text/css" href="css/easyui.css" />
<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script> 
<script type="text/javascript" src="js/tcal.js"></script>
<script type="text/javascript" src="js/ddaccordion.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="css/niceforms-default.css" />

<script type="text/javascript">
ddaccordion.init({
	headerclass: "submenuheader",
	contentclass: "submenu", 
	revealtype: "click", 
	mouseoverdelay: 200, 
	collapseprev: true,
	defaultexpanded: [], 
	onemustopen: false, 
	animatedefault: false, 
	persiststate: true, 
	toggleclass: ["", ""], 
	togglehtml: ["suffix", "<img src='images/plus.gif' class='statusicon' />", "<img src='images/minus.gif' class='statusicon' />"],
	animatespeed: "fast", 
	oninit:function(headers, expandedindices){ 
	},
	onopenclose:function(header, index, state, isuseractivated){ 
	}
});

 


	$(document).ready(function() {
		
		$("#Go").click(function(){
			$.ajax({ 
				type: "POST",
			url : './tradeConform',
			dataType: "json",
			contentType: 'application/json',			  
			  data:JSON.stringify({ "fromDate":$("#fromDate").val(),"toDate":$("#toDate").val(),"symbol":$("#symbol").val(),"qty":$("#qty").val()}),
			success : function(jsonData) {
			if(jsonData!=null){
					
					                $("#datatable").find("tr").remove();
					                var table1 = $("#tableHead");
					                var row=$("<tr style='background:#000000; color:#FFFFFF;'>"+
					               " <th field='id' >Item ID</th>"+
					                "<th field='otype' >Condition Type</th>"+
					                "<th field='insname'>Instrument Name</th>"+
					               " <th field='symbol' >Symbol</th>"+					
					                "<th field='qt' >Total Quantity</th>"+  
					                "<th field='ql'>Total Lots</th>"+
					                "<th field='qw'>Total Weight</th>"+
					                "<th field='price'>Price</th>"+
					                "<th field='ptype'>Product Type</th>"+
					                "<th field='tp'>Trigger Price</th>"+					           
					                "<th field='type'>Order Type</th> "+      
					            "</tr>");
					                row.appendTo(table1);
					                var table2=$("#tableBody");
					                $.each(jsonData, function(key,value) {  	
					                var rowNew = $("<tr style='text-align:center'><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>");
					                        rowNew.children().eq(0).text(value['id']);
					                        rowNew.children().eq(1).text(value['otype']);
					                        rowNew.children().eq(2).text(value['insname']);
					                        rowNew.children().eq(3).text(value['symbol']);
					                        rowNew.children().eq(4).text(value['qt']);
					                        rowNew.children().eq(5).text(value['ql']);
					                        rowNew.children().eq(6).text(value['qw']);
					                        rowNew.children().eq(7).text(value['price']);
					                        rowNew.children().eq(8).text(value['ptype']);
					                        rowNew.children().eq(9).text(value['tp']);
					                        rowNew.children().eq(10).text(value['type']);					                      
					                        rowNew.appendTo(table2);
					                        $("#tableBody tr:even").css("background-color", "#CCC");
						                	$("#tableBody tr:odd").css("background-color", "#FFF"); 
					                });
					                }
}
});
		});
	});
function prof()
{
if (container1.style.display=="none") container1.style.display="block"; 
else container1.style.display="block";
}

function logout(){
alert("You are Logout SuccessFully");
}
</script>

</head>
<body>
  <%@ include file="header.jsp" %>	
    
    <div class="main_content">
    
                    <div class="menu">
                    <ul>
                    <li>LoginID : <sec:authentication property="principal.username" /></li>
                    <li><a href="#">Exchange :
                       <select style="height:15px;font-size:9px;"><option>NMCEX</option></select></a>
                 
                    </li>
                    <li><a href="#">Login Type : Client</a>
                  
                    <li><a href="#">Segment : <select style="height:16px;font-size:9px;"><option>commodity mkt(13-14)</option></select><!--[if IE 7]><!--></a><!--<![endif]-->
                       
                    </li>
                  
                    </ul>
                    </div> 
    <div class="center_content">  
    <div class="left_content">
    
    		<div class="sidebar_search">
            <form>
            <input type="text" name="" class="search_input" value="search keyword" onclick="this.value=''" />
            <input type="image" class="search_submit" src="images/search.png" />
            </form>            
            </div>
    
            <div class="sidebarmenu">
            
                <a class="menuitem submenuheader" href="">Profile</a>
                <div class="submenu">
                    <ul>
                    <li onclick="prof('container1');"><a href="clientpage">Directory</a></li>
               
                    </ul>
                </div>
                <a class="menuitem submenuheader" href="" >Financial</a>
                <div class="submenu">
                    <ul>
                    <li><a href="drcr">Dr./Cr. Summary</a></li>
                    <li><a href='fenlgr'>Financial Ledger</a></li>
               
                    
                    </ul>
                </div>
                <a class="menuitem submenuheader" href="">Reports</a>
                <div class="submenu">
                    <ul>
                      <li><a href="tradeconf">Trade Conf.</a></li>
                    <li><a href="netpos">N.Pos(As on)</a></li>
                    <li><a href="clientport">PortFolio</a></li>
                    <li><a href="bills">Bills</a></li>
                 
                    </ul>
                </div>
                <a class="menuitem submenuheader" href="">Downloads</a>
                 <div class="submenu">
                    <ul>
                   <li><a href="pdf/oct_hn.pdf">Downloads</a></li>
                    <li><a href="pdf/TB_Trading_Regulations.pdf">Reports</a></li>
                    <li><a href="csv/test5.csv">Digital</a></li>
                     </ul>
                </div>
                <a class="menuitem submenuheader" href="">Request</a>
                 <div class="submenu">
                    <ul>
                    <li ><a href="withdrawal">WithDrawal Request</a></li>
                <li ><a href="clientfundview">Client Fund View</a></li>
                <li ><a href="fundTransfer">Fund Transfer</a></li>
                    </ul>
                </div>
                <a class="menuitem submenuheader" href="">Admin Panel</a>
                 <div class="submenu">
                   <ul>
                   
                   <li ><a href="nepalholiday">Nepal Holiday List</a></li>
                    </ul>
                </div>
               <a class="menuitem submenuheader" href="">Settings</a>
                 <div class="submenu">
                    <ul>
                    <li ><a href="changepwd">Password Change</a></li>
                    <li ><a href="transactionpwd">Transaction Password Change</a></li>
                    </ul>
                </div>
                    
            </div>
            
            
    
    </div>  
    
    <div id="container1" class="right_content" >            
<div style="text-align:center;">
<label style=" width:100%;font-size:16px;" ><font color="#663380"><b><i>Trade Confirmation</i></b></font> </label>
<label style="margin-right:5px; float:right;" ></label>
</div><br/>
  <table width="60%" border="1" cellpadding="0" cellspacing="0" align="center" style="font-family:helvetica; font-size:11px;">
  
    <tr style="">
      <td style="width:250px; font-family:helvetica;"><b>Trade Date Fr :  </b></td>
      <td style="width:250px;"><div class="search_rightfield"><input type="text" name="fromDate" id="fromDate"  class="tcal" style="font-family:helvetica; font-size:11px;"  /></div></td>
      
    </tr>
    <tr>
      <td><b>Trade Date To :  </b></td>
      <td><div class="search_rightfield"><input type="text" name="toDate" id="toDate"  class="tcal" style="font-family:helvetica; font-size:11px;"  /></div></td>
     
    </tr>
     <tr>
      <td style="height:23px;"><b>Client Id : </b></td>
      <td ><b><sec:authentication property="principal.username" /></b></td>
     
    </tr>
     <tr>
      <td><b>Expiry Date(optional) :  </b></td>
      <td><div class="search_rightfield"><input type="text" name="expDate" id="expDate"  class="tcal" style="font-family:helvetica; font-size:11px;"  /></div></td>
     
    </tr>
       <tr>
      <td><b>Symbol(Optional) :   </b></td>
      <td><input type="text" value="" id="symbol" name="symbol" style="font-family:helvetica; font-size:11px;" /></td>
     
    </tr>

    <tr>
      <td><b>Unit/Qty : </b></td>
      <td><select style="font-family:helvetica; font-size:11px;" id="qty" name="qty"><option>Qty</option>
    
      </select></td>
     
    </tr>
   
    <tr><td><input type="button" value="Go" id="Go"  /></td>
    <td>&nbsp;</td></tr>
  </table>
  
  <br />
          
<div id="container" style="height:200px; overflow:scroll;overflow: auto">
<table  id="datatable" cellspacing="0" cellpadding="0" border="0" width="300"  style="width:100%;overflow: scroll; " >
<thead id="tableHead"></thead>
<tbody id="tableBody"></tbody>    
</table>
</div>
   </div>
  
  </div> 
    <div class="clear"></div>
    </div>
  <%@ include file="footer.jsp" %>		
</body>
</html>